Fixed a lot of bugs. Added thread management.

Decided that ThreadPool didn't give me the control I needed over the
number of running threads so I implemented my own thread management.
There were also some bugs concerning how relative URLs were converted
into absolute URLs.