added router and tests
separated build into constructor