Set it up so it can be used by node or included as browser script