Added Posgresql support; Added play/listen statistics; general cleanup