python: more correct reference counting, handles ucs2 and ucs4, stdlib module wrappers
python: several more builtin functions and refcounting fixes