Updated gitignore
Added beforeClose event
functionHasArguments() now uses fn.length instead of a regex
Minor refactorings