Changed all defs to vals that I could.

Reordered all serialization to be in reverse-polish to finness the final order it will end up in the file.