Various changes for g++4 on linux - including adding new line to end of file, refactoring of template specialization, and changing header include to ios.