Add API tests

closes #1189
- added tests
- added request module
- added status codes to API calls
- fixed return values of API calls
- fixed that drafts caused an error when being deleted
- fixed X-Invalidate-Cache headers
- moved testUtils.js to utils/index.js
Merge pull request #1322 from sebgie/api-refactor

Add API tests
Remove timeouts on tests
Alphabetical package.json cos OCD
Run tests on MySQL and use travis-$DB environments.

refs #921
fixes #1385
Bugfixes for tests
Merge pull request #1393 from halfdan/1385-travis-testing

Run tests on MySQL and use travis-$DB environments.
Properly format publish date.

fixes #1335
Automatically replace unicode characters with ascii characters for slugs.

fixes #1285
Render a page template if it exists in a theme for a post marked as page.

Closes #1329.
Merge pull request #1338 from halfdan/1335-publish-date-format

Properly format publish date.
Merge pull request #1408 from halfdan/1285-unidecode

Automatically replace unicode characters with ascii characters for slugs...
Merge pull request #1412 from egdelwonk/feature/1329_page_template

Render a page template if it exists in a theme for a post marked as page
Updating Casper to latest inc page template
Move API tests to /integration/

closes #1396
- moved core/test/unit/api* to core/test/integration/api/
- moved core/test/integration/model* to core/test/integration/model/
- moved core/test/unit/utils to core/test/utils
- moved core/test/unit/fixtures to core/test/utils/fixtures/
- changed gruntfile.js to execute api tests with target 'integration'
Merge pull request #1420 from sebgie/issue#1396

Move API tests to /integration/
Add X-Cache-Invalidation Tests

closes #1397
- added checks for x-cache-invalidation to api tests
Merge pull request #1418 from sebgie/issue#1397
Move middleware functions into middleware module and create associated tests
Note: this only moves middleware functions that have associated tests.
document inability to be run on a path below an URL with a hostname - as discussed in https://ghost.org/forum/installation/341-how-do-i-run-ghost-on-a-subdirectory