Rewritten Queue as template - for other usages.
Also created a lot more tests.
Indentation should be consistent now.