Gen reads session, not post, opens new win; tweaky.

Removed Save button - Generate also saves, and opens new window.
Reorganized functions order.