vec: Add .pop_opt() -> Option<T>

Add a function to safely retrieve the last element of a ~[T], as
Option<T>. Implement pop() using pop_opt(); it benches the same as the
old implementation when tested with optimization level 2.
vec: Add .shift_opt() -> Option<T>

Add a function to safely retrieve the first element of a ~[T], as
Option<T>. Implement shift() using shift_opt().

Add tests for both .shift() and .shift_opt()