Add LICENSE.txt; some minor cleanups

- Add LICENSE.txt
- Add a comment about how we handle numbers
- Add more test code
- Fix a narrowing-conversion issue
- Fix a comment typo