Refactored the configuration layer, and expose a 'configure' command

oh, damn it. We really need to keep the php 5.3 compat for this lib.