An elastoplastic framework for granular materials becoming cohesive through mechanical densification. Part I - small strain formulation