make sure we don't hide edit tab if it's the same as view tab

If we're switching to edit mode and the current active edit tab is the
same as the active view tab then don't hide the edit tab
Merge remote-tracking branch 'origin/master'
Add the posts API endpoint to the root of the API

The API now supports distinct posts and memberships, as in the Popolo
specification, but language bindings that explore the top level API to
discover available collections (e.g. popit-python) previously
wouldn't have discovered the posts collection.  This commit adds that
link.
Update to latest popit-api

With the updated fix for the timeout bug
A script to replace the database for a particular PopIt instance

This is missing any way to bring down the PopIt instance before
replacing its database (see #516).
Merge branch 'add-posts-to-api-page'
[vagrant] Move Vagrantfile to the repo root

This allows people to clone the repository then run 'vagrant up' and
have everything work as expected.
Store development uploads in uploads directory

Rather than storing uploads outside the repository root we simply put
them in an 'uploads' directory which has been added to gitignore. This
means that PopIt doesn't write to any files outside it's repository root
by default in the development environment.
[vagrant] Fully configure environment during provision

Make sure that after running 'vagrant up' the user is left with a fully
functional environment, including:

- Changing to the correct directory when they login
- Installing required node modules
- Compiling sass files to css
- Copying development config to the right place
[vagrant] Install postfix instead of sendmail

Postfix is quicker to install than sendmail and appears to send the
emails quicker as well (though this might be due to something else).
[vagrant] Make the host port configurable

If port 3000 is already being used then allow the user to override it
during provisioning using the POPIT_PORT environment variable.
[vagrant] Optionally allow NFS for shared folders

This speeds up shared folder access, but does require the user to enter
their password, so is off by default.
[vagrant] Allow amount of memory to be configured

Rather than having to delve into the config file, allow the amount of
memory to be configured through an environment variable.
Add new instance link to popit homepage

We've now reenabled instance creation, so the text on the homepage
wasn't accurate. Additionally we're now redirecting the live site
homepage to popit.poplus.org, so this text is only shown in development.
Therefore it makes sense to link to the new instance page.
add passport and related auth modules

update package and shrinkwrap
Add passport-local strategy for legacy auth

This allows users to log in using their instance-specific email and
password. Eventually this will become the fallback to the main site-wide
login, and in the long term this will go away entirely.
Remove commented out basic auth middleware
Use passport to authenticate the login request

This removes the custom auth handling code from the route handlers and
leaves it up to passport to do the actual auth.
Add site wide account mechanism

Falls back to instance based auth
Include basic registration page
Login allow access to all instances
Fix jshint warnings