How can I delete internal vertices/faces and edges? I will give you an easy example to understand better the situation:

This is my mesh, a simple one 



In edit mode:



As you can see there are internal faces,edges and vertices that I want to delete. 

I know, one way could be 


select my cube (the bigger one),select P and separate it from the main mesh.
then use the boolean modifier - union 


and the result would be great 



However this method can't be useful if there are many polygons inside our mesh

Is there a script, tool or a modifier that let me delete the internal faces-edges-vertices and let the shape of my main mesh remain, instead of separating each mesh from the main one and using boolean modifier many times?

Thank you!

EDIT FILE BLEND
I think booleans are the answer, but you can do this without separating parts of the object. As of Blender 2.77 you can use the Intersect option in edit mode.

Here I have two overlapping cubes:



Select one of the parts (as shown above) and choose Mesh> Faces> Intersect (Boolean) from the 3D header.

From the toolbar (T) change the boolean type to 'Union':



The two meshes have now been 'merged' with their overlapping geometry removed:



You can either do this once for each piece of intersecting geometry or select all the intersecting pieces (apart from the piece they are intersecting with) and boolean them all at once.