As Gomer Pile would say (to the person who installed this)...
Shame! Shame! Shame!
Anyway good for you! You are on the right track asking questions and planning on properly fixing these things.
The only other question I would have (or something to consider) is if there is another "main" panel before the main panel which this wiring goes to? Like with a building or apartment complex where each unit might have a main panel, but elsewhere on the property would be the main-main panel?
Or is the electric meter right at your main panel where this wiring goes and that is in fact *the* main panel? (I'm having trouble imagining anyone would do this!!!)
Another thing to note is I see what looks to be "romex" or solid wire (building wiring) being used to plug into one of those outlets. Solid wire like this can have the "coat hanger effect". That is if you bend it back and forth many times, the wire will break. Stranded wire can bend many times without breaking. Thus stranded wire is used for things which plug into outlets.