stdlib: Implement head() and tail() functions.