Refactor Function class hierarchy into a single class
Remove ValueType typedef