tweaks to accommodate direct js initialization

begin re-format to per jquery style suggestions.