Closes #321 - javascript consolidation and organization