File model [WIP]

Changes from #24 plus our clean up.