Some rejigging so I can extract useful AngularJS components