Add option to insert Signature at custom index

I added a parameter to the sign() method so you can specify at which index you want to insert the Signature element. This is useful when creating SAML Responses, where the Issuer element should be before the Signature element. Luckily, most of the code already accepted a custom index, I just had to use the appropriate parameter in the sign() method.