Use URL type internally.

Fix #13 and fix #4