Addresses iandanforth/nupic-js#11. Corrects error in mime-type handling.
Addresses iandanforth/nupic-js#13. Added some checks and default values to prevent errors.
Merge pull request #12 from jefffohl/issue11

Issue11
Merge pull request #14 from jefffohl/issue13

Addresses iandanforth/nupic-js#13.