Massive refactor - pure JS/HTML now.