WELD-1751

Based on David's ideas from WELD-1751 and Stuart's PR (https://github.com/weld/core/pull/670)