Upgrade Sugar to 1.3 and adjust to its API