Added better file handling and messaging

Improved file mechanics for detecting dirty and clean files prior to
chaning target file.