Initial implementation of automatic BPM analisys.
Re-write using Promise.