Namespaced the public functions and methods so they are safer in the browser. Fixed semicolon and curlybrace ambiguity.