Perhaps its silly to reopen this after all these months, but I have finally wrapped up my code into a nice package available here:
http://github.com/russkey/TileViewer
It includes the script to split a large file into tiles and a jQuery plugin to put those tiles back together inside a <canvas> element in a webpage. Maybe somebody might find this useful?