This attempts to simplify a lot of the URL building we do by switching
to actual URLs, hiding most of the URL parts slicing inside the Server
(née Client) class.
It also changes the URL format slightly to make it more likely that it
would work against a "pathed" server. The new format is of the form
`http://mmo.localhost/(https://screeps.com/ptr)/#!/map`, ie. the backend
server is now fully within the parenthesis. Note that there's some
backward compatibility, so it should transparently fix-up the previous
format if it's requested.
There's still one small bug; under some combination of parameters, the
URL building will result in silly things like `//` (path: false,
backend: false, asking for the ROOT). But it only happens in specific
cases (the Steamless homepage) and not against the proxy, so I didn't
bother.
At the end of it, the following issues are fixed:
- no more patching errors because of no-ops — PREFIX and DEBUG default
to `''`/`false` respectively, and that triggers the fail-safe of
`applyPatch`. Just skip the patch altogether if the values are the same
as the defaults.
- The history loading for the Season server works now — it's using the
same storage as the normal MMO server.
- It should be a bit simpler to reason about what does what; `hostURL`
should be Steamless' internal host URL, `publicURL` is its public facing
URL; that should help in possibly bringing back the `--backend` option
people have been asking for.