Further refactoring of Cosa Nucleo; supporting thread queues.