Reduce dependency stack of rewrite map script to prevent hangs

Originally Created By: bbieber2

This moves the logic for cache misses to a separate script,
rewrite_miss.php, which will process the rewrite and return
the correct route. The rewrite_miss.php script includes a
time limit to prevent hang-ups from occurring.
Closes #424