Implemented prototype table collection. Relates to #25.

Will require some optimisation at the very least. I'll try to comment on lines that I think are candidates for refactoring.