Programmable framework for automatic tuning of software applications