Modified Castle script for GUI hooks

Should have everything I will need in order to do my GUI work (no
guarantee though). May have more than I need, actually. Being cautious
to ease integration as much as possible.