added unit tests and put Queue into its own file