Added some unit testing for server functions. Currently can't access session variables so can't use all server functions, also the test script stops working after 3 functions (no idea why). But it's a start.