Port: finished util.fst.util class