Adding shim for JS cross platform

Signed-off-by: Ben Jackman <ben@jackman.biz>