Lots of changes:

Moved list of allowed characters in a layout to the global name-space
Convert all level text to uppercase before all the syntax check begins,
rather than at the end;
Character checker is still case-insensitive,
Split line length check into separate function,
Fixed bug in line length check causing an extra space to be added after
the last character in the layout