Fixed the pattern compiler somewhat and added typed tuples.

Generates awful code, but it works!
Fixing indentation and improving backend