Core Services in a Middleware for Mobile Ad-hoc Networks