add option to log application error's

@cheddar @kentquirk   

also get the tests working again