Router experimentation

Pretty lame code, but I'll try to have as much tests as possible before
optimizing it.