Complete sexp serializer patch

Supersedes #30.