Foreman environments stopped working, how to troubleshoot?

I have been testing out using Foreman with puppet and everything was going
great. I had a test environment setup where I was testing conversions from
my old Puppet server at 0.25 to the 3.7.5 I am running with Foreman.

When converting some templates I started to get that puppet could not find
a class that was there. I removed that class and created a new one to see
if that would resolve the issue and it just got worse. I spent a number of
hours trying to troubleshoot and could not find a thing.

After trying anything I could think of to get this resolved, I removed the
host from Foreman and the environment. This included removing everything I
could find on the Puppet / Foreman server's file systems for the server.

Then I created a new /etc/puppet/environments/test3 directory and re-synced
in the files from the old puppet server.

The only thing that works is to setup
/etc/puppet/environments/test3/manifests/modules.pp file with import
"module". While this works, it is not being managed under Foreman.
Foreman sees all of the modules fine and picks up any changes I make as
well.

When I do not use the nodes.pp in my test environment, I get errors from
puppet master --compile <hostname> on the Puppet / Foreman host as well as
on the client. Ideally we do not want to have a nodes.pp file with import
lines to get the modules to come in.

Finally I made yet another environment and did a puppet module generate on
it. From there I pasted in code from a working module and that one showed
up fine and worked with the host.

I am completely confused now.

I have used the --debug --verbose flags to puppet and run strace against
the puppet master command, but that did not give much information.

The really quirky thing is that when I go look at puppet classes, I see the
old ones I removed showing up in the list with 6-8 hosts showing. I deleted
those entries as well, but no luck,

What are the next steps to troubleshooting this problem? Foreman is a
great tool, but I don't have any information regarding how to check the
database and look for corruption.

I would appreciate any information that those in the group can provide. I
really want to setup a server with modules and templates ready to go to
Puppet 4.x in the future without having to do a forklift upgrade like I am
doing now.

Thanks!