cv_ckproto should disregard spaces

This included some refactoring to break down the original
large if block into smaller, more manageable chunks,
although the only functional change was to pass the two
string buffers through S_strip_spaces.