Refactored naive bayes, neighbors methods and template. option parsing.