Change core to pass in request and move test

This allows for far more intelligence involved in actual request
handling (including, but not limited to doing more interesting things
with dynamic URLs).