Should use pathname instead of path, since path can also contain query string
Initialize config with parsed query string
Cleanup and tests for #1 and #3.