Clean up / make the core Markov logic more functional.