Changed flush buffers to match new database

Should be very easy to add new metadata fields in the future, no
server-side changes necessary.
Merge pull request #39 from dannybutler/master

Changed flush buffers to match new database