Check the database_dir flag and make sure the directory exists
Merge pull request #9 from Medium/xiao-check-database-dir

Check the database_dir flag and make sure the directory exists