Refactor URL handling out into separate class

Decreases the clutter in AppDelegate a bit.