Changed code in several functions relating to getting a simple filename from the full filename that is stored in trialMetaData. Created a new function that checks for this, and all other functions call it