Regarding your last statement, and depending on how much experience you have with the software-dev side, you may find you have more options than you expect. Lots of folks seem to be looking for software devs at the moment, and I personally would see the mathematics background as a potential bonus (even if not directly applicable it generally suggests a certain amount of rigorous consideration that is beneficial for software development as well). There appear to be quite a few remote options (see the "who's hiring" discussions) but also, if you're willing to relocate, my employer would likely be interested. E-mail me at my username @ gmail.com if you'd like more details/to discuss further.
Sincerely, A just-finished-being-forty electrical-engineer-turned-software-dev
PS I'm planning to write up a response to the OP next; check that out for a little more insight into what my employer is like