Adds better error throwing for edge cases

- Includes tests
- Conforms to strict mode
- Remediates global scope pollution

Pair programmed with [Mary Rose Cooke](https://github.com/maryrosecook) at [Hacker School](http://www.hackerschool.com)