Command-line and import support added, pep8'ified