Atomized the code a bit to make it more unit-test compatible
Add unit tests for s3_secret_file functionality