Replace argv parsing with argparse, added if __name__ == __main__ block and main() function, added doctests
Merge pull request #1 from dangayle/master

Refactored to use argparse, added the if __name__ idiom, and added doctests