Added tests. Started redesign of errors into log package