Adds angular ui router, Re-factors code