top level option support
Change global options structure from array to object
Fix some global variables
Merge pull request #3 from LesTR/master

top level option support