ADD: move functional tests to its own file