Turn numtostr portions of write into its own function

Move rest of the write function into std.s
Move around variables as needed
Add special case for 0 and -0