Implement upsert, finish ActiveRecord crud API, lots more

Tighten up argument handling in several places using new validator
functions from Functoids, flesh out upsert in TableGateway and in
ActiveRecord, refactor ActiveRecord to no longer use braindead
ActiveRecordState class (much better now!), refactor AR API: it now uses
insert/update/upsert/delete, just too much to mention here. See the diff
please ;)