added proper merging of deep associative arrays

The array_merge in the configuration doesn't correctly merge the deep associative array as it only merges the first level of the array. Thus when you miss out configuration options from the params config array you run into errors.

So I've added a deep recursive merge function to correctly merge in the specified configuration options.

There may be other places where there are incorrect deep merges and you may need to update accordingly.