Add browser interop through js pkg
Convert functions to standard javascript functions