loader.cpp: improved file extension checking, made Upper/LowerStr useful

Instead of forcibly taking the last 4 characters, it now finds the last extension separator (the period) and takes a substr of its location.
Added string_util to common, small changes in loader.cpp
Moved common_types::Rect from common to Common namespace