File model

Changes from #24 plus our clean up.