Pep8 and assorted cleanups on multi-part userdata

General cleanup and minor refactoring.