Moved some things around to make it more librarish

Librarish is a word, right? I need this code for something else(RPNCalc) and I need it to not have rules builtin