Is there an algebraic approach to metric spaces?
A very complete reference is the book "Lipschitz Algebras" by Nik Weaver. In there you will find various types of spaces of Lipschitz functions that can be associated to a metric space, and several results of the kind you are asking about.
From the book's introduction:
Thus, there is a robust duality between metric properties of $X$ and algebraic properties of $Lip_0(X)$. The set of weak* continuous homomorphisms from $Lip_0(X)$ into the scalars can be isometrically identified with the completion of $X$ (Theorem 4.3.2); Lipschitz maps from $X$ into $Y$ correspond to weak* continuous homomorphisms from $Lip_0(Y)$ into $Lip_0(X)$ (Corollary 4.2.9); closed subsets of $X$ correspond to weak* closed ideals of $Lip_0(X)$ (Theorem 4.2.5); and nonexpansive images of $X$ correspond to weak* closed, self-adjoint subalgebras of $Lip_0(X)$ (Theorem 4.1.10).
I guess I'm late to the party, but here are a couple of points:
Yes, an arbitrary complete pointed metric space $X$ with finite diameter is characterized up to isometry in terms of $Lip_0(X)$. $X$ is naturally isometric to the set of weak* continuous homomorphisms from $Lip_0(X)$ into the scalars. See Theorem 7.26 of the second edition of my book.
In response to another comment, the restriction to diameter at most 2, for spaces without a distinguished base point, is natural. For these spaces the Gelfand transform takes $X$ isometrically into the unit sphere of $Lip(X)^*$. A metric space can isometrically embed in the unit sphere of a Banach space if and only if its diameter is at most 2.
The natural functions in this context are Lipschitz; e.g. functions $d_x(y)=d(x,y)$ determine an isometric embedding of a metric space $X$ to $L_\infty(X)$. For a noncommutative analogue see G.Kuperberg, N.Weaver, "A von Neumann algebra approach to quantum metrics", http://front.math.ucdavis.edu/1005.0353