Bug fixes, change file output names

Each measurement now puts out a separate file including all measurements done up to that point.

Following bugs fixed:
- Reset some variables where measurements were stored to NULL inside the for loop, resulting in data being overwritten. Now fixed. 
- Some match evaluations did not have their nomatch set to 0. By default if no match is found, NA (coerced to an integer) is returned. Setting it to 0 instead allows the to be evaluated as FALSE instead.