Using the echo command adds unwanted br tags to source

If this is plugin code there is NO REASON the theme would make a difference. My guess is it’s a server issue (outputting of /n) or a WordPress function that changes the /n into <br>

I would check wpautop() as I find that sometimes it’s this functions fault. See this post on the WordPress.org forum for more.