Update python samples for --strict-caps

Allow Python sample code to work with `--strict-caps` turned on on the server. Also clean up a bit and fix for changed UICatalog.app.