Moved stuff into jslib