Add support for shallow merge

* Updated `inheritance` param to be an `opts` param taking both `inheritance` and `shallow` `Booleans`.
* Kept backward compatibility for when a `Boolean` is passed as a third param.