rewrite as class
fix missing semicolons
moved class properties defs after main function, added comments
add comments
add arrayify function
some simplifications
fixes
throw nice error if config require fails
revise option validation
update tests
revise and simplify options validation
add some comments