Extensive code restyling so it meets dojo style guide.  This is mainly replacing spaces with tabs.
return code to previous version before the has("dom") clause was broken-up.
Added todo.