Preliminary commit for boolean grammar and constraint model

* ApplicationEntry is made polymorphic behind the scenes
  This is to allow efficient database queries using the standard
  Django filter() method.