major changes: complete switch to array-based syntax definitions, lots of fixes