first stab at a Func type
switch query::db to use Func type

I think I like this; also fix generation of broken RQL JSON syntax for
optional arguments.
finish switch to building Funcs everywhere
bikeshed names of Func factory methods
clarify example a bit