Use of medications would totally defeat the purpose of fasting to detox though wouldn't it?
Anyway, I forgot to address the issue of sleep problems. In the past when I fasted I would get up early in the morning and hold out all day long without sleeping. By the time it gets dark you'll get so tired you'll want to sleep. Rest, stretching and meditation is fine during the day as long as you don't sleep. This has been the best way and I also get through my fasting days waiting for the pleasure of sleeping at the end of the day because I know that's when your body does it's most repair and processing and you see the results the next day.
Making sure your sleep schedule (circadian rytthm) is normalized before a fast is one of the best ways to insure success during a fast.
Currently mine is a little off and I can't fall asleep before late but keep trying.