Restructure distribution functions

- extract distribution functions into own package
- implement max function
- wrote test for beta distribution function