Added in sampling functionality.  Broke out classes into their own files.