Router restructured, router tests added