Added function for label point collision testing.

Also changed screen size updating function.
Moving from canvas-based menu to html-based one.

Also moved utility functions out to their own file.