Added auto screenshotting. Various bugfixes and tuning.