some namespace simplification
Merge pull request #1269 from Yangqing/dev

Minor change: some namespace simplification
move registration code to corresponding cpp files.
Merge pull request #1270 from Yangqing/dev

Give back to layer what is layer's, and to factory what is factory's
Revert "OpenCV should be compiled using pkg-config options." -- breaks
compilation on working systems

This reverts commit 4587b2f9043996fed36fc989c00329ec829ecae9.
some namespace cleaning.
Merge pull request #1277 from Yangqing/dev

some more namespace cleaning.
Refactored leveldb and lmdb code.
Some cleanup to make travis happy.
Updated interface to make fewer string copies.
Don't autocommit on close for the databases.  If they were read-only, then they might fail.
data layer test was relying on the autocommit on close db behavior that was recently removed.
Updated cifar10 build script to specify db backend.
Switched create_cifar10.sh output from leveldb to lmdb.
Updated extract_features to take a leveldb/lmdb config option.
Updated Database interface to use custom KV type rather than std::pair.  Removed two buffer copies in dereference operation for DB iterators.
Added a couple of sanity checks to make sure the datum buffer sizes matched what we expected.
Added get interface to Database.  Added test cases for Database.  Fixed a few bugs related to ReadOnly mode in Database in order to pass test cases.
Added some tests for the Database iterator interface.  Updated the post-increment operator so that it forks off a copy of the LevelDB or LMDB iterator/cursor when necessary.  Neither of these APIs allow you to directly copy an iterator or cursor, so I create a new iterator and seek to the key that the previous one was currently on.  This means the pre-increment operator can be much cheaper than the post-increment operator.
Updated Database interface so that rather than CHECKing for certain conditions inside open, put, get, and commit, these functions return a bool indicating whether or not the operation was successful or a failure.  This means the caller is now responsible for error checking.