Both StreamListener and the functional model require many code paths that are common. Refactoring them for better use and readability. Resolves #674