Fix insert_before in CredentialResolver

This method was not updated to use the same interface
as insert_after.  Now both methods are working as expected.
Added a unit tests for insert_before, as it look like there
previously was not one.
Merge branch 'fix-insert-before' into develop

* fix-insert-before:
  Fix insert_before in CredentialResolver