fixes #2 by adding smarter url parsing

BTW, this pull request was created using this very tool. That's about the best acceptance test I can think of ATM.