Refactor health script

This is a cleaner design that doesn't depend on script execution order.
It also prevents health regeneration from causing the player to exceed
maximum health.