fix bug introduced by re-ordering init tasks
add debug routines and read string values from config
refactor state structs to use copy instead of initializers, plan to eliminate state struct