1. Tell your wife ASAP about the job situation. No matter what stress she is under, learning about it later may cause serious problems. She can help you (emotionally and in trying to find answers to your problems). The better off you are emotionally, the better chance you have of finding a job quickly.
2. I've seen stories like yours a lot in my career. Some people are selfish. A disproportionate number of these seem to end up in management/entrepreneur roles (luckily, not all!!!). To your boss you were merely a source of cheap labour. Take the "cheap" out of the equation and he was not interested any more. I'm afraid that this is probably not the last time you will run into this, so be prepared.
3. This is locking-the-door-after-the-horses-have-bolted kind of advice, but if you find yourself in a similar situation (it happens a lot in this industry): get the new job first and negotiate for salary second. It's horrible, but that's the way you have to do it.
4. If you get the new job first, think hard about whether or not you really want to negotiate salary in the first job. If in doubt, don't negotiate -- just leave. I tell my employers up front that I don't negotiate salary, so they have to be prepared to offer me enough that I will accept. They won't get a second chance.
5. Remote working with no academic background and 8 months of experience means that the next job is going to be tough to find. Keep at it, even if you have to take another job doing something else in the mean time. Eventually you will make it, though you may be in for some difficulty for a couple of years. Trust me on this one.
6. I hate to say it (I really do), but depending on where you live, your salary expectations may not be reasonable. For example, $45K USD is very nearly $30K GBP. In London, I can get university graduates with intern experience lining up outside my door for that salary. In hourly wage it represents $22.50 per hour worked (8 hour day -- excluding holidays). That's 2-4x minimum wage in the US. If you are offered that salary again, I advise you to take it. Just do whatever it takes to keep working (easy for me to say, I know). Keep looking for the bigger payout and don't worry about "loyalty" for now. Once someone respects you enough to offer you a good wage, then work on building a good relationship with them so that you can grow together.
- It may take you some time to find another job. In the mean time, spend every free second you have writing code. Build an amazing portfolio. Some people don't care about it, but I have gotten good jobs from my side projects.
Again, the biggest thing I have to say is not to get too upset or disappointed. Just keep moving forward -- even an inch is enough. Whatever you can do right now is enough. Never give up. Good luck!