Fixed errors and bugs in config.go and got some tests going. Could be improved though