Updated DBdataMapper, also fixing #35

Still some work before issue #34 can be closed, but the datamapper
should now be set up to allow that fix as well.
Minor bug fixing and code improvements