Moving more functionality into angularjs.