reorg tests into unit and functional

unit tests run first, then functional tests.