Merge pull request #6 from xaizek/master

Restore value of 'cpoptions'
Some buffer/window trickery to get auto-closing working

Other alternatives tried either segfault or don't quite work correctly
in all cases. Mind you, no guarantee of this working, either.
Simple ad-hoc test script

Nothing serious yet, don't have the energy to build something at the
moment.
Don't try to reset anything if nothing initialized
Introduce function to check initialization state