Changed directive to act like a state machine.

Directives will now parse each character instead of a line,
they are not required to know about comments. This will
force directives to parse information as a state machine.