caching with leveldb

caching with leveldb, ready for push
Merge pull request #73 from leriel/master

Close #33