Move file replacement to map meta reader

File modification and replacement were in two different classes, both
were moved to map meta reader. Also cleaned exception handling.