Refactor lib/facebook.js to export a BASE_URL for FB graph server.

This is primarily just so we can easily integration test the library
with a fake server.

Also made a few minor formatting changes to make some lines not so
long.
Added lib/facebook test suite. Only tests publishComment() for now.

This is something of an integration test, since it actually sets up a
fake open graph server that the library talks to.
slightly better test names.
fixed an error message bug in lib/facebook.js.
Added tests for extendUserAccessToken(), checkApplicationAccess() to fb lib.
some fixes to fake facebook graph server.
Added tests for publishBadge() to facebook lib.

However, this required changing the behavior of the function, because
its current behavior seems odd: it's calling an internal function,
publishGraphObject(), which parses the JSON response of facebook and
returns the id of the new open graph object. But then the caller
attempts to parse that id as JSON, and return it, which seems odd. So
I changed the function to just pass through the id. Will need to ask
@davelester if this is ok or not.
Pull migration related files from #668
Store image data when we award.
Only use pull the necessary migration
Use Badge#getImageUrl in views.
Don't log image requests.

It will quickly get out of control and will add a lot of noise to the
logs.
Performance: Use indexOf instead of regex
Remove done todo.
Rearrange a little bit.
Add conmock test for badge.image controller.
Merge pull request #728 from brianloveswords/726-use-image-data

Use image data from database instead of relying on local files.

[closes #726]
Make virtual field, `imageUrl`
Use imageUrl attribute.
Remove dead code.