Rewrite in progress

Wrote batches.py, which still needs testing, but is free from syntax
errors. It may need some refactoring to handle more general cases
cleanly, such as security settings, different screen sizes, etc.

Currently working on screengen.py.