Refactored DBUtil to Doctrine 2
Merge pull request #657 from drak/permissions_doctrine

Refactor Permissions module to Doctrine
Correct typo
Add some convenience methods.

This is more to help with back porting code from 2.0
remove unused imports.
Convert to namespaces.
Backport Category conversion from 2.0
Backport Category conversion from 2.0