remove guest editing from codebase

now that we have can have multiple users per insance it no longer makes
sense to have guest logins

Fixes #577
initial token based api authentication

still needs to check if the permission for the token holder is valid for
the operation
basic api key management

page on hosting app to request and remove an api key.
use roles for api auth

and correctly handle the fact that legacy users do not have roles or
permissions
Update to latest version of popit-api

This includes the fix for dropping the elasticsearch index before doing
a reindex.
Don't redirect to homepage after resetting password

On the live site the homepage redirects to popit.poplus.org, which is
confusing to users who have just reset their password.
Allow the reindex script to take and instance slug

Rather than reindexing all databases, if you give it an instance slug it
will just reindex the given instance.
Add script for importing an instance from JSON
update node to latest version - 0.10.31

Mostly to remove arbitrary 1GB memory limit
git ignore for node-assets build folder
only save organisation when editing a person if new

This then skips the post save action in the API that reindexes all the
documents in the membership which in the case of organisations that have
lots of assocaited memberships is extremely resource intensive and
causes the server to fall over
Fix elasticsearch mapper errors

Upgrading to a recent version on mongoose seems to have caused issues
when indexing dates in elastic search so downgrade to a known working
version as an interim measure while working out how to fix the problem
Add Get API Key link to instance app user menu

Removes a step in the process of getting an API key
actually apply API auth checks

This corrects an error when removing the guest login functionality that
would allow API access with no authentication
remove the API key from the request so it isn't saved

For #612
correct jshint failure
allow instance DB name to be different from slug

when instantiating the db connection for an instance check for a dbname
property on the instance. If present use that as the DB name suffix,
otherwise fall back to the slug name for backwards compatability

Note that as connection details are cached any operation that changes
the db either needs to remove the cache entry or restart the popit
process.

Fixes #583
Part of #516
update replace database script to just change instance pointer

Change the script to import the data into a new database and then point
the existing instance at the new database. The new database is called
the same as the old one with the date in yyyymmdd format appended.

For #516
copy across instance settings when replacing db

we need to do this otherwise we lose the description etc.
allow instances to be marked unavailable

Add in middleware to check if an instance has been marked as unavailable
and a script to change the setting

Fixes #516