fixed up hook system so it doesnt suck

and changed some entity functions slightly