Updates to prepare for SQL implementation

This branch should be the necessary changes for SQL without including anything yet. Maybe this is a good candidate for v2.0.

Specs pass for me, if you agree I think this might be ready for a merge to master.