Snapshotted. This also fixes issue 1076 by testing in inPub whether obj is of type object or function (i.e. that it's allowed on the right of an "in" expression). Also added tests for the various bugs that turned up during this exploration.
http://codereview.appspot.com/93041
