MicroHD: An Accuracy-Driven Optimization of Hyperdimensional Computing Algorithms for TinyML systems