Added support for functions and classes/interfaces.

eventually decided to dive into this...