Basic code updates.
Details:
    - Add netrc option for user's email/password.
    - Add option for setting the user-agent string.
    - Consolidate main body of code into a main function.