Rewrite the whole project

This rewrite moves from the ad-hoc Promises/A+ solution to a more robust and flexible solution using monadic promises and RxJS observables.