Added testing and better configuration parsing (which has been split out)