Better docs for writing extensions

The new tutorial from this pull request is built here: <http://docs.ckan.org/en/943-writing-extensions-tutorial/extensions/>

Our current docs for writing extensions aren't very useful. They could do with being rewritten, possibly with a structure along these lines:

1. Overview (introduce key concepts)
2. Tutorial (step-by-step tutorial for developing an example extension, using a real working example, no assumed knowledge, no steps missing)
3. Troubleshooting
4. Best practices
5. Reference

Issues to cover:

* How to do i18n for extensions
* How to do tests for extensions

Somewhere we also want to fit in the guidelines.

Related issues:

* <https://github.com/okfn/ckan/issues/847>
* <https://github.com/okfn/ckan/issues/790>
* <https://github.com/okfn/ckan/issues/781>
* <https://github.com/okfn/ckan/issues/922>
* <https://github.com/okfn/ckan/pull/481>

Note that pretty much all of the reference docs for every plugin interface need rewriting for clarity and detail, and almost all of the plugin interfaces need example plugins and tests. This is a big job and I suggest making a separate github issue for each plugin interface. But finish this ticket first.