Add strict mode to the project.

For avoiding some JavaScript flaws.
Add charset for html pages and refactore.