fixed error in CorporationsDB::ListNPCDivisions   select statement was asking for non-existant columns divisionNameID and leaderTypeID
fixed an error "missing semi-colon" in prime_db.sql
added a HasAttribute function that will also return the value if present.
removed some redundant non-const functions.
Modified some uses of get/hasattribute to use the new version of has attribute and be more efficient.