added functional test framework and ported tests.
closes #27 and closes #36