Implement SplDoublyLinkedList::add

Summary: Closes https://github.com/facebook/hhvm/pull/3390

Reviewed By: @LiraNuna

Differential Revision: D1484817

Pulled By: svcscm
Expect object or string in class_implements

Summary: Closes https://github.com/facebook/hhvm/pull/3393

Reviewed By: @fredemmott

Differential Revision: D1484793

Pulled By: svcscm
Set Cwd to the realpath, exclude all "../" etc.

Summary: Closes https://github.com/facebook/hhvm/pull/3424

Reviewed By: @fredemmott

Differential Revision: D1488966

Pulled By: svcscm
GMP cleanup/fixes

Summary: - Fixes a memory leak in gmp_init
- Removes uses of mpz_clears/mpz_inits, which some GMP versions do not have (should fix #3421)
- C++ functions that should be static are now static
- Re-adds miss-merged lint fixes
Closes https://github.com/facebook/hhvm/pull/3425

Reviewed By: @fredemmott

Differential Revision: D1488974

Pulled By: svcscm