Numerous bugfixes

fixed some memory leaks and null pointer references,
added operator associativity,
unary operators now actually work,
more error codes and messages,
more optimizations