Add parse rule for labels and refactor tests