Add method to convert a PyNumber to a JavaScript number

Signed-off-by: Daniel Francis <francis@sugarlabs.org>