Refactored mariadb and elasticsearch build files