Complete Refactor

Refactor to fix async bug-add dependency functionality and added more
fire tests