A British man has appeared in court accused of fighting as a platoon leader for Somalia-based Islamist terrorist group Al Shabaab.