Initial commit of collect.py. Provides basic functionality for formatting and manipulating raw stream data.