Refactor InternalLoader to use promises

Refactor InternalLoader to use promises instead of ad-hoc listener interface.