Further cleaning up pt, hal code and porting uart demo