Expanded docs.
Added exception wrappers.
Merge branch 'capakey_gateway' into caching

Merging changes in capakey_gateway branch with caching branch.