First commit; tests don't all pass yet.