Added write_prepare, write_plain, write_commit to python binding.