Cleaned up unused code, modifications to use applicatives
Fixed bug in generation of non-message streams