It's very simple using mod_rewrite for the simple case.
RewriteEngine on
RewriteCond "%{HTTP_HOST}" "^([^.]+)\.example\.com$" [NC,NV]
RewriteRule "^(.*)$" "%{REQUEST_SCHEME}://%{HTTP_HOST}/%1$1" [L]
Getting Your 1st point is not possible as You can never request just the hostname.
If You type it like that, in the browser or the client it gets always the / appended as the HTTP protocol requires some URI to request from the server which cannot be the empty string.
Depending on You exact requirements it can get more complex.
For example the above solution would not convert the case of the received host-header, so the resulting URI has the username in exact the same case as the requester sent in host header.
It ignores the case of example.com as DNS names are not handled case-sensitive by default. But the resulting Username could be MJohnson, Mjohnson or mJOHNSON, however the host header is sent and these are normally different strings.)
So for example to always force the username in rsulting URL to be lowercase You can replace the RewriteCond line wih the following:
RewriteCond expr "tolower(%{HTTP_HOST}) =~ /^([^.]+)\.example\.com(:\d+)?$/" [NV]