Refactored tests.

- Moved the test program generation in its own class.
- Added some tests to SExprPath.
- Added some utility functions to make the tests cleaner.