Clean up some unnecessary SQL
Add serialization code for changes.

This closes #3 althogh improved documentation and testing is required.