Reworked parsing, much more efficient. Now also handles negative numbers (I hope) and functions.