Changed js to use module pattern and use strict. Cleaned up jshint errors