Updated build.gradle

Added and fixed many build functions.