Hat support added, not so good yet
Done some preliminary stuff for hat support