Crazy simple, just maps F5 to comment and F6 to uncomment based on the filetype. This requires the Filetype plugin to be enabled (default in 7.2). The replace is non-destructive of leading whitespace, feel free to remove it if you wish.
Note: Multiline commenting style ie., /**/ is unsupported, however, using the mapping in visual mode with text selected will apply/remove comments to the entire selection
Another Note: To get around accidently copying html entities just click the download button, put the file in ~/.vim/after and add the following to your .vimrc file (this also allows you to easily disable it if you don't like it
source ~/.vim/after/mapped-commenting.vim