update .gitignore.
tidy up code, add BOOT_FILES, refactor
add emacs backup files to gitignore