Copy prototype from Nick's repo.
Fixes bugs on menu dropdown, simplify code.