Adding some javascript snippets.
Big restructure of init file.
Improving php getInstance snippet.