Move function declarations to stem3.hpp