Add #commit() method to persist changes to disk

fix #5