Implement simple auto shutdown for test purposes
Condense code with some macros
Provide structures for holding all async operation states