LOGBACK-384 - IllegalArgumentException for logger name with mixed '.' and '$'

Fixing the logic to treat '$' and '.' at same level as per comment [1]. Also adding a testcase

[1] http://jira.qos.ch/browse/LOGBACK-384?focusedCommentId=13105&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13105