Improve ivar handling by using regex to handle type and name.

Also optimize ivar handling by checking lengths of type/name and address strings
before doing anything heavy.
Reformat file according to PEP8.
REBASE.