adding r.info and d.legend outputs, more js quoting, handling bg color for rendering