Improved accent algorithm - slightly prefer accent on the first beat. Tweaked things for UI integration.