Merge pull request #320 from travis-ci/sf-sexp-2

Refactor to use an intermediate sexp representation