Add types file with aliases for pattern and value arrays
Add EventArray type
Make event use Array types
Make p_sequence use Array types
Fix a couple of segfaults in the scheduler, and make it use the Array
types