Implemented trait mocking.

See #113

Also, be sure to merge #112 first as tests may fail without it.