more work on mongo data storage, starting to use some coffee-script