Remove chunk of commented javascript code used as reference implementation.
Minor code reorganization.