Tests + refactoring
Add queue interface