Moved template functions to header files

Just learned that you can't compile template functions in the source, as
the compiler builds a custom version of the function for each template
used in the code.
Added c++11 flags and fixed object file output

Set up the recipe to output object files alongside their sources