Imported pull request changes from 8bit.js.

This pull request is essentially identical to: https://github.com/meenie/8bit.js/pull/14