fixed bug in extend
added base class option, classes-to-base option, and default class for base