Added macro based circular buffer and updated uart library to use it.