Make puppet-clean a function

Making it a function is more easy on the eye and help to understand what
it does.