Refactored code a bit. Added workaround to make this module available for using with the original compoundjs.