Refactored expression module, added unit tests.