Refactor sms service functionality in a separate module

Also enhance server side data validation to return all errors at the
same time.