Improve UMD wrapper

Move require out of call to AMD define to prevent re-loading of chia
module (circular dependency).