Add missing constant case for undefined values
Test encoding of undefs
Tidier undef handling
Merge pull request #44 from Ralith/fix-undefs

Fix undefs