add stopProgagation to handled keyDown events to prevent accidental form submission.
fix isUndefined function that was mistaking functions for arrays