Changed structure of glmnet code, hopefully eliminates parallel access issues to sqlite database