Javascript reorganize.  Much more elegant, now.