adding dense version of liblinear
refactoring to reduce code duplication
refactoring to reduce code duplication