Added resize action
Some code style refactoring. all leading underscores for outer scope variables
Some refactoring and cleanup
Renaming some vars
Added screendump action with optional selector argument