added ui-router. Separated code into files