redesigned package to operate like npm module.