Check if username is valid and remove slashes from filename

@Raydiation @karlitschek @tomneedham