Update plugin.js

Added logic to check if val is an object in the in the process function and use JSON.stringify if it is.