Move unit_t to static runtime, add serialize().