Moved app JS to a separate file

Removed $.(function(){}); to use only ‘deviceready’