Replace function for layername

Removed replace for layer name. And added tests for a couple different source types.

cc @rclark