Added spec testing for functions and defines

Skipped the define for mkuser since it's already covered at large from the class spec test.

I can't get exception testing for functions to work. Skipping that for now.