+consolidated stream gen code (previously in 12 locations) into one php file. 
+NO DEBUGGING OR TESTING YET
+still need to write corresponding JS