UI and code refactoring

Completely separated Piece Class from App Class which fixes newPiece
copied canvas bug.

Add detection for both iOS devices and when they are in mobile app mode.

Lots of code refactoring tidying.

Renamed dot.js to main.js