Parse router code into routes object