Cleaning out comments - moving them to documentation later - and tidy code a bit.