Serialize/parse octal numbers

This adds support for serializing and parsing numbers in octal. I'm not 100% happy with the changes I made for parsing, it's not very elegant so please consider 52eaf9e and 3d37220 carefully and feel free to reject those changes. The serialization stuff should be fine however :)