Fix unpickling closures. Closes #1

Github user jdc2172 correctly noticed in #1 that `types.function` no
longer exists in python3. In testing the change, it appeared that
unpickling closures did not work properly. The fix was to use
`types.CodeType` correctly, and use proper bytestrings. A quick test
showed that this now works properly.

Thanks for reporting, jdc2172.