major code rewrite & cleanups
fixes a few bug

+ restores function delete by mistake before
+ passes unit tests
renames variables
simplifies blocks

+ adds caching for log factorials
+ removes unused functions
removes unused functions and updates headers
renames files
updates vignette; ports msFile2jsfs to Rcpp