Work on modeline parsing.

Fixed one issue of illegal c99 code where array indexing used a negative number
to look behind.

Mostly splitting finding out if it's a modeline from chk_modeline into another
function. Also some more documentation, formatting and sanity checks.