rafactored a lot of code, added requirejs and jquery