first steps to a cleaner DAL and rname integration

plus some pep fixes