Replaced core graphics background drawing code with CAGradientLayer, other minor bug fixes and changes