—
I found the angle here based on the closest edge or point on the collision polygon, but then if you have that then shooting a ray is excessive. In short even though I thought it over casting rays isn't useful to solve the problem. The most I can think of is to shoot a bunch of rays out and picking the closest one, but that is imperfect.
The sliding is done by correcting the overlap oppiset the angle chosen and the canceling the velocity going in the direction of the angle. That can be done by utilizing a dot product.
The algorithm I used can be made faster by not checking far away objects and/or implementing it in JavaScript. A plugin may be ideal but to me that's a pain to make and maintain.