FR1: Implement durable storage; fix #12; clean-up some code