Removed commented out tests associated with resolved tickets.
Inlining function used in only one place for clarity
Repeatedly in-lined functions to simplify containing function scope and remove queue.call