Added save logic with in memory test. Closes #1