Improve configuration.js

- Cleaned empty paths in configuration object before sending to server
- Replaced usage of 'eval' with a custom function