Implemented a critical new function: numbers.

The implementation is very complicated and so it is in it's own file.