Bug 994453 part 1.  Factor out the to-JS conversions from Promise.h into mozilla::dom::ToJSValue methods.  r=bholley

Apart from moving the methods, I made the following changes:

1)  Renamed them to ToJSValue.
2)  Inlined the boolean overload.
3)  Added overloads that take integer types.
4)  Changed the order of the aCx and aArgument arguments so aCx comes first.
5)  Renamed "abv" to "obj" in the typed array overload.
Bug 994453 part 2.  Use the new ToJSValue methods so we have an example.  r=bholley
Bug 994793.  Make the array bits of ToJSValue nicer.  r=bholley