Version 0.1 - refactored to use promises and added command line options