fixed errors in document loader, moved ngram extraction to new library
fixed some linkings and includes