Resolves arguments for RecordingContext helpers. You can either specify a div & selector to find the canvas, or omit this if there's only one canvas being recorded.
function findRecorder(div, selector) {
  if (!div) {
    if (!RecordingContext.recorders) {
      throw 'You must call RecordingContext.recordAll() before using other RecordingContext static methods';
    } else if (RecordingContext.recorders.length == 0) {
      throw 'Called a RecordingContext method, but no canvases are being recorded.';
    } else if (RecordingContext.recorders.length > 1) {
      throw 'Called a RecordingContext method while multiple canvases were being recorded. Specify one using a div and selector.';
    } else {
      return RecordingContext.recorders[0][1];
    }
  } else {
    return RecordingContext.recorderForSelector(div, selector);
  }
}