Going to start user authentication things.  I am following a tutorial and am not quite done yet putting the code in - so there are lots of errors at the moment, but still need to set up lots of the code.

Most notably I am trying to split up the authentication stuff in its own folder so we don't see it so much in "app" - since app should be responsible mostly for routing and setup
Should probably actually reference the usermodel
Added the rest of that tutorial code and formatted this file.  Now let's comapare to another tutorial to see if I am on the right track.
I like the way tutorial 2 addes the authentication methods instide the mongoose schema.  Lets do that.
Work in Progress - Creating authentication controller to do the work that passport was doing for us before.

At the same time I got the bright idea to create handlers rather than a big switch statement ~ but I forgot how js objects work -

TODO - move the handler collection out of the prototype into the main closure along with the handler methods - though maybe I should just go with the big switch statement at this point
Moved my passport-like code into an authentication controller.  Still quite a bit of work to do, but after testing these basics we can probably pop back on the dev branch
Oh, this is how you specify the collection in mongoose.  Little code changes here, but I am shifting to use the global mongo datastore at c:\data\db rather than in this project
Going through this basic auth code and removing some obvious problems - most importantly the scope of the handlercollection was still the global scope, but I need it to be the controller so we use call to bind this when we go in there.

Perhaps I am not doing this a very "node.js" kind of way - but because I am handling I have functions to handle the errors right here and there, which are not really blocking, I don't really need the callbacks.
More bugfixes - successfully got something registered.
Okay don't want to include the collection thing here - that will rename the collection in the db we are using.  Just want to connect to brogue db just with the connection url.
Getting rid of local here makes it work - I think I had an old tutorial.

Basic authentication functionality seems to work now.  We just need to scopet the user, but that is not the scope of this - I think it is ready to go back to dev