Selection cleanup

This PR fixes spaces, comments and other style issues surrounding selection and selection filter code.