jQuery.extend with configurable behaviour for arrays