3.0 fix btm marshaller

This fixes the bug https://github.com/cakephp/cakephp/pull/4237 was trying to fix, but adds support for composite keys and tests