Added Events and AppLogic
Split app into separated js files