Custom handlers for auth and storage, simplified tests structure, added rights management backends

Changes for my own project, may be useful for main trunk.
Custom handlers should close issue #88