Rename Annotator.Plugins -> Annotator.Plugin
Add AnnotateItPermissions plugin, implementing permissions for AnnotateIt's API

After some discussion, I've agreed with @aron to commit this as a separate
subclass of the Permissions plugin, leaving the Permissions plugin as a
simpler example of using the annotation permissions field, while putting all
the rather more complex authorization logic used by AnnotateIt into its own
easy-to-use plugin.

In addition, I have cleaned up the implementation of the Permissions plugin,
leaving even more of the work to the userAuthorize function. Unfortunately
this has changed the signature of the userAuthorize function, and it will
necessarily be slightly more complicated than it previously was, but
ultimately it provides all the same default logic, with the ability to
completely customize the authorization behaviour.
Add AnnotateItPermissions plugin, implementing permissions for AnnotateIt's API

After some discussion, I've agreed with @aron to commit this as a separate
subclass of the Permissions plugin, leaving the Permissions plugin as a
simpler example of using the annotation permissions field, while putting all
the rather more complex authorization logic used by AnnotateIt into its own
easy-to-use plugin.

In addition, I have cleaned up the implementation of the Permissions plugin,
leaving even more of the work to the userAuthorize function. Unfortunately
this has changed the signature of the userAuthorize function, and it will
necessarily be slightly more complicated than it previously was, but
ultimately it provides all the same default logic, with the ability to
completely customize the authorization behaviour.
Update default AnnotateIt read permissions to be group:__world__
*Actually* update default AnnotateIt read permissions to be group:__world__
Only set read perms to group:__world__, update perms still group:__consumer__
Refactor AnnotateItPermissions plugin and add support for per-consumer admins
Refactor AnnotateItPermissions plugin and add support for per-consumer admins
Update test syntax and stubs
Update test syntax and stubs
Merge pull request #208 from edsu/okfn

document annotator plugin
Merge pull request #208 from edsu/okfn

document annotator plugin
annotateitpermissions: set user correctly for new annotations

The AnnotateItPermissions plugin previously partially inherited the Permissions
plugin's `addFieldsToAnnotation` method, causing the 'user' field on new
annotations to be set, incorrectly, to the entire auth token rather than the
string user ID of the authenticated user.

The result of this was that the authenticated user didn't have 'admin'
permissions on brand new (unsaved) annotations, and so the "Allow anyone to
{view,edit} this annotation" checkboxes didn't appear in the UI.

This commit adds a test and a fix for this behaviour.
annotateitpermissions: set user correctly for new annotations

The AnnotateItPermissions plugin previously partially inherited the Permissions
plugin's `addFieldsToAnnotation` method, causing the 'user' field on new
annotations to be set, incorrectly, to the entire auth token rather than the
string user ID of the authenticated user.

The result of this was that the authenticated user didn't have 'admin'
permissions on brand new (unsaved) annotations, and so the "Allow anyone to
{view,edit} this annotation" checkboxes didn't appear in the UI.

This commit adds a test and a fix for this behaviour.
Merge pull request #217 from okfn/jquery19

Upgrade jQuery and replace jQuery extensions
Merge pull request #217 from okfn/jquery19

Upgrade jQuery and replace jQuery extensions
Merge pull request #226 from okfn/feature/remove-annotator

Add a #destroy() method to Annotator
Clean up Viewer and plugin tests

Many plugins expected DOM events to be used for the transport of (e.g.)
'beforeAnnotationCreated' events. This was fixed to use Delegator custom
events.

A number of plugins instantiated an Annotator with a default Store
plugin. These have been updated to use the NullStore.

Various other fixes.

And a passing test suite :)
Consistent Annotator.$ and exports in plugins
test: update all tests to require their own deps

Rather than having each test suite rely on global scope, this change
causes each test suite to become a self-contained module, which is
forced to explicitly require its own dependencies.

This is ugly in places, but only because it exposes underlying couplings
in the test suite. This is a good thing, because it will hopefully
encourage us to remove these in future.

One major open question is how dependencies should work for plugins. At
the moment, plugins inject themselves into the Annotator namespace,
which requires that each plugin file require()s the core Annotator
module. This seems wrong: we should probably be working towards plugins
which can be entirely standalone, and which have the relevant Annotator
instance provided to them as a constructor argument (i.e. dependency
injected).