clean up agent
add threading macros for creating composite channels, using an input chan