Are there ways to prevent, or make it difficult enough, for someone to inject Javascript and manipulate the variables or access functions? A thought I had is to change all var n
Obfuscation and minification should make it a good bit more difficult to hack, but I agree with spender.