Refactors code.
Adds gitignore with build/ dir listed.