Bugfix and definition of custom foreign key names

 * added a static method for active record classes to specify a default foreign key name
 * removed remaining usages of class name for table name