Implement assertion normalizer

We don't want to change the output of the displayer API yet so this
function takes the new assertion data and puts it in roughly the form of
the old assertion (which is the form that consumers of the displayer API
expect).
Remove controllers/issuer.validator

It will need to be reimplemented, but for now it's a distraction since
it's likely going to have to be re-written from scratch.
Remove old validation tests.

I want to start from scratch with the tests so I can get a better
implementation that caters to the new validator rather than trying to
shoehorn the new validator into the old validator output.
Upgrade `nock`.
Cleanup package.json

* Remove unused dependencies
* Be explicit about dev dependencies so when installing on prod we do
  not have to do extra work.
* Removed `functools`: it was only used in models/portfolio.js and the
  usage was pretty insignificant. I refactored the function in question
  to not use `functools.compose` and added a test to ensure correctness.
Cleanup/modify makefile

* Add `migrate` task
* `start` depends on `migrate`
* Make `test` the default task
Drop `public_key` field from badge model

We don't need it since the assertion itself should contain the public
key necessary to validate the badge.
Rename `jwt` column to `signature`

We are not using JWT for the signatures, we are using JWS, but we should
just be generic and say `signature`.
Drop `type` column from badge table.

Right now, 100% of the badges are "hosted". Even when we get non-hosted
badges, the `type` can be inferred from whether the badge has an
`endpoint` or a `signature`, so it's more suited to being a method on
the model.

If we encounter the day when we need to do a superfast search on whether
a badge is signed or hosted, we should create an `index` table that has
that information foreign keyed against the relevant item in the badge
table.
Drop `rejected` column from badge table

We didn't use it and I don't think we have a need for it in the
immediate future.
Remove a bunch of outdated binaries

* bin/db_to_utf8.js - was a one off, better done with a migration anyway
* bin/deployer, bin/start, bin/update.sh - from the initial development
  process, these wouldn't work now anyway.
Refactor controllers/issuer.js: whitespace
New function library: analyzeAssertion

`analyzeAssertion` will be the wrapper for `openbadges-validator`. It
will deal with going out and grabbing the assertion if necessary and
normalizing any errors. It should be fairly lightweight and provide
detailed error responses so the consumers don't have to do much to
convert them into helpful user-facing errors.

Currently I've only tested 0.5.0 style assertions but theoretically it
will work with both as-is. I plan on implementing this in the codebase
instead of the various chained `remote` calls before I deal with testing
assertion version 1.0.0 support
Use `analyzeAssertion` in issuer endpoint

Before we had a few nested steps: first we would get the assertion, do
some validation, then get the badge image, then try to award. There were
a lot of points where the process could fail and the parts weren't easy
to test independently.

I've replaced the first two steps with `analyzeAssertion`, which uses
openbadges-validator underneath. It deals with the error handling when
an assertion url is malformed or unreachable, and defers to
openbadges-validator for the rest of the error handling.

There are still some ways to clean this up - the `analyzeAssertion call
should probably exist and middleware and the GET and POST conditional
parts should be two different endpoints - but this is a start.
Fix normalize, keep more data

* Use clones for `issuer` and `badge` structure to avoid modifying in
  place
* Keep a copy of the original recipient
* Store the remote locations of the `badge` and `issuer` structures
  under the '_location' property.
Remove unused library.
Implement Badge#getFromBody

This is a safe method for getting deep items from the body of a badge
assertion. Instead of doing `badge.get('body').badge.issuer.origin` and
worrying that it's going to blow up if `issuer` is not a property of
`badge`, we can use `badge.getFromBody('badge.issuer.origin')` to get at
the deep propertites without having to do a bunch of &&'ing.
Use `normalizeAssertion` in the issuer endpoint

We want a normalized assertion structure to pass to awardBadge, so we
shouldn't just directly use the `assertion` property from the
`analyzeAssertion` return value.
Support new assertions in `lib/award.js`

`award` now accepts a `signature` property and won't try to bake a badge
that doesn't have an endpoint set.

We need to figure out badge baking for signed badges, but for now we
don't have time to deal with it.
Migration for `image_data` field.

We need to stop storing badge images on the disk. This is the first step
to doing just that. It creates a new column in the `badge` table and
tries to populate it with the contents of the files pointed to in the
`image_path` column.