Closes #145 File cleanup and resource fixing

This should into 4.5.40 and must precede #70 Change file linking to use folder linking