Added URL trimming

Fixes #32, untested