Add allowed values and nested variables

along with a bit of a refactoring to reveal intention.
Some control over immutability
PHP 5.3 compatibility

bugfix: using self:: in callback not supported in 5.3
Merge pull request #24 from brightmachine/master

Add allowed values and nested variables & a bit of refactoring to make intention clearer