I'm pretty sure I released the code to my Mario in Graal remake:
http://forums.graalonline.com/forums...hp?t=134257825
Although it's in GS1, it should help you out as it contains gravity and more importantly, the slopes you are asking about.
My method for dealing with slopes was to designate a portion of the tileset to specifically angled slopes, and while those tiles were under the player, snap the player to it proportionally to their position on the tile. For example if a 45degree angled slope is under the player, their y position would be player.y = int(player.y) + player.x%1; Of course, this depends on the direction of the angle. Shallow slopes get a bit more complicated as it begins getting into multiple tile detection, but again, all the code is there.
As for gravity you should definitely start from scratch, it's painful to try to get gravity working with default movement. Hell, even on a small event on UN I ended up coding all custom movement and hit detection just because it was a platformer event.
Also, I seriously suggest putting the physics in a class so you can join all appropriate objects to it, so you can easily apply the worlds physics to all objects.