New gamma

Review and extension of an old PR aimed at improving the gamma functions.