Closes https://gitlab.com/commento/commento-ce/issues/69
I know this is a huge commit, but I can't be bothered to check this in part by part.