Added tests and implementation for file downloading.