refactor

Adds a TileViewer class.
Adds a Utils namespace with a few static functions.

Split in two .js files.