Extract the admin functions from the main class

This pull requires is to separate the admin functions form the admin class, it also merge the pull requests in #27 and #29 with some other enhancements.

Fix issue #31