Fixed bug where domains are not cleared when resetting the client in the
server behaviour. Added API to retrieve domains so that they can be
listed in the UI.
Unit test changes to take into account staging when attempting to
download content from an app's URL.