console update

functions can be written and registered now. also change some if
statements into switch/case statements for performance