Added a permission model for pages, and fixed oodles of bugs.

Including necessary additions to `install.php` and `upgrade.php`. Big thanks to @onmoon for the original implementation!

Also includes:
* Bug fix to `reorder_pages()`, which appears to be missing args in its update call.
* Enhancement to error message sanitising in order to retain prettified errors.
* Bug fix for unicode emoji implementation, as discussed [here](http://chyrp.net/discuss/topic/seems-times-like-830-break-posts/page/1/#message_1402).
* Bug fix for clean -> dirty URL translations for archives.
* Added cookie policy message for EU legal compliance.