Added ability to set credentials when creating a context.