Add create_permission to ensure that permissions are created with the correct type.

This function creates and returns a permission object of the correct
class (Permission vs. WildcardPermission). As such, it is useful for
creating a permission where you do not know at compile time whether it
is a Permission or WildcardPermission. In the event of id conflicts
(the permission already exists), this function returns False.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Add new API call api/core/permissions/register

Allows applications to register new permissions that they use. This is
intended so that applications can have permissions they won't
necessarily know about before intialization (run-time permissions),
such as the ability to write to a specific forum. Applications are
restricted to registering applications within their own scope
(as enforced elsewhere in the permissions setup).

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Merge pull request #316 from Acidity/feature/permissionsAPI

Add permissions calls to the Core API