moved all the free functions unrelated to vector to the detail namespace.