Add library code created so far. Pretty functional, although might use some tidying.