Add functional class approach.
Merge pull request #2 from srijs/class-fun

Add functional class approach.