more modular solution using two helper functions
fix for raply
fix for rdply
adapt r_ply to the structure of the other functions

fixes #158
r_ply honors .print parameter

fixes #164