I believe that the nuts you collect don't matter for your level. I say this, because there were a few times where I would die and lose all the nuts I had collected after my last checkpoint, which means I would have to replay part of a stage... yet I would get a level up before hitting the section I died at. So, even though the nuts I collected before dying reset, it seems like my XP didn't.
Based on my experience, you seem to get more XP if you play the stages that you should be at. By this, I mean that you should play through normal (maybe redoing a few stages here and there to get money for better equipment) and beat the game, then move on to hard and insane. If you simply keep playing normal, hitting level 50 will take much longer.
In order to hit level 50, I had to...
1 - Beat the game on normal.
2 - Replay 5-10 stages for extra $$$
3 - Beat the game on hard.
4 - Replay 5-10 stages (on hard) for extra $$$
5 - Achievement popped halfway through the first stage on insane.
All told, it took about 12 hours total. I had a lot of fun with it though, and it never felt like a grind.
Based on comments from DaywalkerUK and Cringer85, you seem to level up faster if you play with someone who is a higher level than you. So, if you can find a level 50 character who wants to play with you, you will probably level up even faster.