Reworked comment sanitizing

Made sanitisation a helper function and added regex to strip obnoxious
attributes from tags (not perfect but effective).