3x performance increase on NB data

Used data.table convenience functions to replace vector subsets
Merge branch 'Performance2'