Restructure code to new architecture.

The frontend is now only capabable of serving up the frontpage and logging in users, creating a new User in the core database.  This is pretty hacky, but will be cleaned up as part of the AuthUser story.
Sorry, that wasn't commented much in the code.  The REST client can 
provide the version via ETags to do stronger conflict handling.

On 2014-06-18 18:12, Elsa Balderrama wrote:
>
> In modules/core/tests/test_user.js:
>
> > +    });
> > +
> > +    afterEach(function() {
> > +        oldUser = null;
> > +    });
> > +
> > +    it('should only allow the user itself to update', function() {
> > +        expect( user.command.update ).withArgs(
> > +            { userId: new Types.ObjectId() }, oldUser, {}
> > +        ).to.throwException(
> > +            function (e) { expect( e ).to.be.a( command.PermissionError ); });
> > +    });
> > +
> > +    it('should reject conflicts when requesting specific version', function() {
> > +        expect( user.command.update ).withArgs(
> > +            { userId: id, version: 4711 }, oldUser, {}
>
> in what case is the version going to be requested (or not)?
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/commonsmachinery/catalog/pull/33/files#r13923980>.
>