Convert the Twang object into a class

* Convert the Twang object into a class for more robust data
  representation. Abstract away private data members, exposing only
  public member functions
* Rework the code structure for global definitions and AMD support;
  took a page out of mustache's book :)