added functional test framework and ported tests