Make the library compatible with browser environment and get rid of underscore dependency