Added support for build cleanup functions
[fix #22] Completed support for cleanup functions