Move code into a class.

This allows me to keep my API Key/username in a separate file and not
check that in. Also good for testing (later).