Refactor: make some string lengths configurable.

The strings that are now configurable are connection string and
device name. This is necessary because in embedded environment
1024 bytes for connection string is wasteful. As is 256 bytes
for device name.