Made key database key the same as httpkey key format

Also fixed a bug in addDocViaManager
Merge pull request #49 from yaronyg/master

Made key database key the same as httpkey key format