Fixed mapper functionality for select or insert. Refactored out reflection code into reflect functions lib.