Add foundation for loggers
Replace all error calls with a logger call where it may be appropriate
Adjust behavior of wait and create wait' function