add mapping protocol to objects
rename mapping function and fix build issue
remake static method in protocol to instance method
Merge pull request #4 from leoru/master

add mapping protocol to objects