Fix a bug where counters collection would increment even when insert of user or tweet did not occur.

The counters collection is incremented and the _id field of the next entry is obtained before it is inserted. If the insert fails because duplicate user name, the counter would remain incremented. Bug is now fixed.
Sort tweets (most recent first) before returning them.

Mongodb can return documents in any order. A sort function is now called before returning the final result.
Started rework of API to add paged responses
Paginate the responses to requests.

Requests to /api/timeline and /api/user/:userid/tweets now accept start and end parameters.
Only these tweets are then sent. If the parameters are not supplied, it defaults to 1 and 20.
Removed /test API.
Move auth to its own route

Auth should now be considered a route by express. This was done to enable authentication on CORS requests.
Enable CORS support

Added allowCrossDomain function that runs before every request. This enables javascript clients to access the API.
Add library passport.js to handle authentication

Authentication now handled by passport.js instead of middleware bundled with express.js
This is because CORS requests are not being authenticated.
Delete old functions from database.js

Removed functions that were no longer being called - populateDb() and checkAuth(). The latter is now done in auth.js
Discontinue CORS support

Since the cause of the problems with accessing the API though js is not apparent, CORS support is temporarily being dropped.
Related code in server.js has been commented. Passport.js is still being used for auth, because it provides superior documentation.