UMD
Use prototypes to cut allocations for high-frequency types, minor refactor to tidy things up a bit.