Class var cleanup

The better fix for those "top-level class variable" warnings is to just not use class variables.

Also, do_create and do_update can share a single method to populate optargs, which removes five duplicate lines of code.