Minor speedup. Replace strncmp with explicit char tests.

 First commit on fork'd repo... meatier changes to come :-)

(Have some more significant changes to improve speed. Submitting this trivial
one as its my first contribution via github. If this goes ok i'll submit the rest)

Alex Davies.