Mostly adding std:: for strstream interfaces.
This may contain prexisting 64-bit issues, caused by hammering pointers into ints.