Added command line argument parsing and a ton of doctests for that.