Re-wrote the RestClient to expose async and sync functions (depending on
the platform). For synchronous functions, always prefer a request made
through sockets over the urlLoader (i.e. when sys is available).