support for pair end read demultiplexing

major formatting changes, support for pair end read demultiplexing and
addition of helper functions