Add LoadFile function and getmines macro