Reworked closure paradigm to export API at bottom of each closure

Also updated .gitignore to defualt from github