Updated affordance implementation to fit with new bayesian math, rewrote learning, knowledge bases and pipeline as well.