Cleaned up directives regex.

Things with the word 'local' where not being parsed properly due to
bad regexing. Cleaned up the regex to not be so ugly and also fixed
some spacing issues.