Makes the use of integer types more consistent.

Uses the integer types like i16 or u32 when an API takes integers with defined size (e.g. int32_t or i32).
For unsigned int it uses uint. I've moved that typedef to a more suitable location.
Also changes the conversion for long and unsigned long because SpiderMonkey now has conversion functions for 64 bit integers.
It's still not quite consistent from the perspective of just looking at a file and seeing that some loops use int and some u32 as counter, but casts for the function calls wouldn't be better.