Move stack.h and stack.c to lib