Updated analysis tools, refactored out plotting from analysis