Permission checks bugfix.

Corrected two "subtle" copy-paste-induced bugs; the permission checks in
editcontent referred to the wrong (read: non-existant) variables,
leading to permission checks of the form 'contenttype:foobar:edit:'
instead of 'contenttype:foobar:edit:23'.

Fixes #834.
Change htmlmaid dependency to 0.5.1

This change is required because older Maid versions have an unsuitable
PHP version check, causing PHP versions between 5.3.6 and 5.4
(exclusive) to fail.