Moved reserved word checking to a function. Realised some reserved words
can be used as conditions while others can't. Need to find a definitive
list of what is allowed and what is not then make some updates.