Making cglib dependency optional

Pull request of issue #812