test14 tweaks

Handled window resizing better.
Moved global vars up.