Updated script to separate out commands function and also create a plugins subdirectory for adding in additional functionality.