Clean + comment + improve code

Clean code : comment + HTML5 + JSNI + try, catch
Add the applet code to build separately