First commit of everything from BeliefPropagationReference, line endings LF changed to CRLF