Implemented most of the other operators. Lots of code duplication, but I don't see any way around it right now. May refactor later.
Added global variables.