Improve handling of preserved comments; make custom function helpers public

Details in commit messages.