refactor output tags and added support for changing base url

fixes #6063