Deep Reinforcement Learning for the Control of Energy Storage in Grid-Scale and Microgrid Applications