Moved menu toggle JS out of HTML

Separating the mark-up form the JS should make it easier to maintain the code.