use fs-extra for moving image files on upload

means that even if the source and destination paths are on different
partitions it will work
do not save blank entries for other_names etc

Without this clicking add for other_names etc and then not filling in
any details and then clicking save will result in a blank entry in the
other_names field of the person. This then causes #528 to occur when
saving a photo so we remove any entries that are entirely blank.
explicitly set other_name etc to undefined when saving

We need to remove these by hand when they are empty as the set method
ignores undefined keys.

Fixes #547
use update instead of save for image operations

This means that if something is broken in the other aspects of the data,
such as other_names not having a name which was possible due to a bug,
then the photo operation will still occur without error as the
validation isn't being fired on the entire object. Without this you end
up with a 500 error and you can't delete any photos.

Fixes #528
Fix jshint errors
prevent overlap of input backgrounds on political tab

add a bit of top margin and also remove grey background from select2
elements to stop the grey backgrounds on the political tab mashing into
each other

Fixes #526
fix problems with multiple edit tabs displaying

before we match the active edit tab and the active view tab hide the
content of the currently active edit tab as the easy tabs API doesn't
seem to do this for us.

Fixes #544
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
Add master method to popit class

This enables easy access to the master connection rather than having to
store a separate one for accessing accounts.
Add configurable cookie domain to session middleware

Allow the cookie domain for the session middleware to be configured and
default it to the new setting.
Move registration app out of the main auth app

This allows us to use the registration part of the auth app in the
hosting app rather than in the instance app. This is preferable because
people will want to register for an account before creating an instance.
Add supertest dependency
Split up the app from the server

By separating these two modules we can test the application in isolation
using supertest without having to worry about the server starting up and
binding to a port.
Move sessions and auth into the master app

Rather than handling these separately in the hosting and instance apps
it's more straightforward to just handle these in the top level
application. By doing this we can reuse the same logic to keep the user
logged in across instance and hosting apps.

I've also switched the sessions to use signed cookies rather than mongo
which is much simpler and removes problems with hanging connections when
testing.
Tests for the registration process

These are some basic tests for the popit registration process. They're
full integration tests, so hopefully they can be a basis for future
tests are of sort.