Updated preprocessing

Updated code to look a bit neater and added preprocessing of document
tokens for bag of words model.