Refactor UIButton

The current code for UIButton has a lot of repetitions. Refactored it in preparation for another patch to allow setting of SpriteFrame in images (02ccfe0cf408136fec2c824fc9d2e811448c6c54) to be followed in a subsequent pull request.