Flatness, preorders and general metric spaces (revised)