Modify print_model_weights.py to make main() flexible

- Modify the main() function to take a list of arguments as if specified on the command line. This makes testing easier.
- Modify console script tests

- Modify all tests that run the console scripts to call the corresponding main() function instead of using subprocess since the latter has no effect on test coverage.