Idaho law does not consider a moped with an engine less than 50cc as a motor vehicle if the cycle has pedals and can be propelled by human power. If you have a bicycle with an engine kit that is less than 50cc you are not required to have it registered, titled by the DMV. And according to the statues if it isn't required to be titled and registered then it is not considered a motor vehicle therefore you are not required to have a driver's license and insurance. Fight those tickets in court. Judges in Boise have been tossing those tickets out. The state even tried to appeal but lost in the appeal because of the specific exclusion of the registrations and title requirements for mopeds. The only caveat is if the officer clocked you doing more than 30 mph. If so then the moped is classified a motor-driven cycle. Then you would need a DL and insurance and a motorcycle endorsement on the DL. Don't go faster than 30 mph.
Here is the relevant Idaho statue:
http://legislature.idaho.gov/idstat/Title49/T49CH1SECT49-114.htm
Would be section 9a - Note the no title requirement there.
Definition of motor vehicle:
http://legislature.idaho.gov/idstat/Title49/T49CH1SECT49-123.htm
Would be section h - "Motor vehicle does not include vehicles moved solely by human power, electric personal assistive mobility devices and motorized wheelchairs or other such vehicles that are specifically exempt from titling or registration requirements under title 49, Idaho Code."
Mopeds are specifically exempt from the title requirement as per 9a above therefore it is not classified as a motor vehicle hence:
http://legislature.idaho.gov/idstat/Title49/T49CH12SECT49-1210.htm
"49-1210. Certificate of insurance as proof. [EFFECTIVE UNTIL JUNE 30, 2017] (1) Proof of financial responsibility, as required by the provisions of section 49-1208, Idaho Code, shall be furnished for each motor vehicle registered by any person required to provide such proof, or shall be furnished by any person required to provide such proof even if the person is not the owner of a motor vehicle."
A moped is not a motor vehicle therefore it isn't required to be insured.
And finally this:
http://legislature.idaho.gov/idstat/Title49/T49CH3SECT49-301.htm
"49-301. Drivers to be licensed. (1) No person, except those expressly exempted by the provisions of this chapter, shall drive any motor vehicle upon a highway unless the person has a current and valid Idaho driver's license. Provided however, that those persons holding a restricted school attendance driving permit may drive upon a highway pursuant to the restrictions set forth in section 49-307A, Idaho Code."
A moped is not a motor vehicle therefore there is no requirement for a driver's license.
As for the ticket for driving it on a sidewalk is concerned you will have to pay that one. It is a municipal code violation. No way around that one even as a bicycle if your township has an ordinance which forbids riding on sidewalks. Next time stay as far right on the shoulder in the the direction of traffic flow.
To be safe I wouldn't recommend that you drive with the engine on until you go to court and get those driving without a license and insurance thrown out. And then keep a copy of that court dismissal on your bike when you ride so you can show it to the police when they pull you over again.
Also stay off state highways. We are not allowed to drive mopeds on them.