Improves test environment and adds tests for routing (still incomplete)