[RFR] [Plugin] #10 Create plugin engine on Php side for JS

This PR includes commits for #9 and #10.