Pressing a PadButton will trigger click

It is up to the client to suppress the click using the waitingForRelease property. May add another proeprty to make this opertion.
Cleaned up some javascript functions