support specifying reference node to insert signature after

This is useful for SAML implementations that expect the signature to be placed after the Issuer, if not it fails validation. 

I added a new parameter and if it's not passed, it will behave as before.