Adding permutation calculations.

Added permutation method in basic.js as well as tests for permutation in basic.tests.js