Added more permission functions

SmartObject Management Server Permission functions added
re-organised K2Module as it is getting a bit big
Finally started doing some Test Driven Development so there are now test
files for testing Env Lib and Smo Permissions.