clean up modbutton spaghetti, fix that bug for agentlame
additional cleanup and refactoring
merged masted, resolved conflict
Merge pull request #114 from Dakta/master

clean up modbutton spaghetti, fix that bug for agentlame