Fix TODOs.

Attempt to account for big-endianness.
Don't call sqlserialize unnecessarily.
Try to avoid memory-leaks.