Add {r,l,}trim functions in misc.pm

refs #2783
icinga 2: Convert minute interval properly and trim whitespaces

fixes #2783