Patches for issues #6, #7, #8 from ezimuel/PHP-Secure-Session master

Refactors some things internally for easier extension.

Add two new test/demo cases.