Start thread_safe_queue refactoring

Refers #49