implementation of R2 database access (passwords and usernames) and testing bayesian binning for histograms