Added tests and documentation for valueOf.
Added the implementation for valueOf.