Adapted HttpMachine to use Task, await and async. Attempted to update tests to match.