Completed initial source code

I intend to remove the queue data structure, and refractor and clean up
a bit.