Final callbacks replaced with Deferred usage.

Code cleanup almost complete. Then it's time for tests and features.