Refactor bayes and resolve bugs caused by importing old codes and new
package namings. gitignore is also updated for eclipse dev.