refactored tinfoil.js by abstracting some checks
updated build tasks and formatting