expand ~ in paths to the users home directory

If the site uri starts with ~/ then expand it to the users home
directory.  ~user style paths aren't implemented as part of this change.
Use a temporary map for loading the sites list.

When loading the site list, build the mapping in a temporary variable
and then swap it.  This (I think) fixes a race condition where sites
will not match while the configuration is being updated.

As far as I know, swapping out the map like that is an atomic operation
and this does not require the use of a mutex or making 'sites' not a
global variable and using goroutines to pass around the latest config.
Merge branch 'siterace'