Added NPM script
Added logf function and other misc changes