fixes #201. Added constructor taking a custom RestTemplate. Also fixes p...

...repareRequest, which failed to apply the prepared headers.