My problem is however with analogWrite() function which seems to set the PWM to HIGH whenever you write analogWrite(PWM, 255)
Yes it does, it is designed to do this because it is designed to use an 8 bit timer.
I like the convenience of the analogWrite function but this is something that needs to be taken care of,
So write your own function, call it something like analogWrite10bit.