switching loadByName to take an optional options object instead of requiring dirname