Refactored to use NSURLSession and marked up for appledoc documentation generation.