update code to work with MongoDB. store PDF in GridFS

store log files on filesystem to eventually support websockets and
`tail -f`