Move <script> tags to top of body

Having <script> tags at the bottom of the <body> caused some widgets
that relied upon JavaScript to fail, as the required libraries had not
been loaded at the point where the widgets were added to the page.
Refactor edit handler JavaScript integration

Edit handler panels which required JavaScript provided the JavaScript in
a `render_js` function, the output of which was collected together and
inserted after the `<script>` tags in the footer. Now that the
`<script>` tags are at the top of the `<body>`, these collected
initialisations were failing when they could not find the elements.

A new set of widgets have been created: `AdminPageChooser`,
`AdminImageChooser`, `AdminSnippetChooser`, `AdminDocumentChooser`.
These widgets output the initialisation JavaScript in a `<script>` tag
immediately following the widget itself, assuming that the required
external libraries and scripts are now included further up in the page.
This is how the GeoDjango fields from Django work, as well as many other
third party widgets. It makes writing integrations for arbitary widgets
easy, as they do not have to know anything about Wagtail edit handlers.

This also removes the need for the `fixPrefix()` JavaScript function
wrapping all field initialisers. As the fields are initialised as they
are inserted in to the page, any scripts included with them are inserted
at the same time. Additionally, the `__prefix__` placeholder in empty
form fields is also present in the initialisation scripts, and is fixed
at the same time. A template tag `escapescript` has been added to help
with this, to prevent `<script>` initialisation blocks from prematurely
closing the `<script type='text/django-form-template'>` tags.
Merge branch 'bug/missing-migration' into bug/scripts-at-bottom

* bug/missing-migration:
  Add missing migrations
Fix migrations after merging in missing migrations
Fix Python 2.6 compatibility
Catch 'jav\tascript:alert("XSS")' as a bad URL

The URL checker from html5lib was used as inspiration. As html5lib is
based on the same ideas that browsers (should) use for parsing and
checking, this solution should be much more robust.
Tabbing from password field goes to Submit
Added get_indexed_objects method to Page
Make search signal handlers use get_indexed_objects
Search: Added new deduplication method Fixes #710
Search fields can be overridden again. Fixes #709
Added system check for ForeignKey cascade

Pages can be linked to other Pages, Images, etc through ForeignKeys. If
the object being referenced by a page gets deleted, the page itself will
be deleted as well. Also, the page will not be cleanly removed from the
tree (leaving orphans, out of date num_child, etc). It is very common to
accidentally forget to set the on_delete action to models.SET_NULL.

This pull request checks all ForeignKey fields on pages and makes sure
that they are not set to cascade. If they are set to cascade, the
developer will be warned of their mistake.

This only works for Django 1.7 users as it uses the system checks
framework.
Use latest_revision_created_at in sitemap gen

Much faster than looking it up manually for every page in the site
Fixed login form to reference USERNAME_FIELD

Was hardcoded to say 'username' when USERNAME_FIELD may be 'email' etc.
Fixed JSON Oembed error on Python 3

=> TypeError: the JSON object must be str, not 'bytes'
Fixed failing oembed tests
Updated LoginForm to dynamically set placeholder text

Placeholder text is now determined from the verbose name of AUTH_USER_MODEL's USERNAME_FIELD
Added 0.8 release notes to index
Auto register signals only works on Django 1.7
Wagtail 0.8 is in development