Jh output3

This is pull request of changes in output system. All commits in this branch are git cherry-picked from JH-output.