Add module for rewriting s3:// to public://.
Minor refactoring.