Fixed score masking and scripting optimizations

Score masking is now computed like so:
  1. Merge all template labels for a given template
  2. Create a mask from the merged label
  3. Resample each subject into template space using linear transform
  4. Compute score between template and subject over masked region