pickling and unpickling at the scalajs side