Javascript object to DOM translator