implemented tests

broker server into smaller files