functional feature injection in javascript