Small changes in __main__ to run from CLI or Eclipse