Some refactoring and adding Bayes FMM plots.
Fixed merge conflict