fix flaky test EXPECT_EQ code, using EXPECT_FLOAT_NEAR per Jeff
fix flaky math functions, remove unnecessary instantiations.
Merge pull request #1264 from Yangqing/dev

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

Minor change: some namespace simplification
Refactored leveldb and lmdb code.
Some tool updates that I forgot.
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.
Updated Database interface to take key and value by const reference for put and key by const reference for put.  Additional copies are made for get and put in the LMDB implementation.