Updated for Lua 5.2
Removed __persist and upvalue support, since I can't get it to work with Lua 5.2. Standardized the serialized length fields.