Refactoring File writing to a utility class for reduced code.

+ Added a FileWriter class to simplify things.
+ Added a gradle task to do everything (ie. compile, and run the app)
Refactored the build and file writer.