Added JS handling of tilt, and added click handlers for the Java part