Pass config through more functions and fix dialyzer errors

maybe add `-nn` flag. Could speed up some things.