The file_write() function now supports copying existing files.

Added source_root parameter to file_write() used to find existing files.
Used copyfile() standard library function to implement actual copying.