Implement .pop_opt() and .shift_opt() for vec

Implement methods .pop_opt() -> Option<T> and .shift_opt() -> Option<T> to allow retrieval of front/back of a vec in one operation without fail. .pop() and .shift() are changed to reuse the former two methods.

Follows the naming of the previous method .head_opt()