Add tuples to the ffi remapToJs method

Added support for mapping tuples to javascript (as standard js Array)
Re-ordered type checking for optimal performance