update to avoid use of library() within functions

recommended by @sean_anderson, following
http://r-pkgs.had.co.nz/namespace.html