javascript plugin to convert object with functions to string and string to object