Fix comment cleaning, implement it as a plugin

Comment cleaning is still not perfect but it seems to work better now. Both it and doc collapsing are now plugins.