Create abstract class to reduce code duplication

The new abstract class 'PieChart' will define public methods and enforce
an interface for the different versions to extend. In this way, multiple
graphics libraries, such as GD, Cairo and Imagick, can be supported
without unnecessarily duplicating common functions.

- A consistent format for storing colours will need to be implemented,
  to avoid cross-compatibility problems between graphics libraries.

- The output and saving functions should probably be rewritten to ensure
  that headers are set and files are saved consistently; this will also
  reduce duplication.

- The code for the current Imagick and GD versions will obviously need to
  be refactored!