Added memory queue and tests