Improve errors thrown by the server
Another stepping stone in the grand scheme of #267 (closed).
This MR is a WIP effort to convert the instances of
panic/error in the codebase in either proper exceptions (if thrown by effectful code) or use a trick similar to what I have done here with
fromDBid to have a proper stacktrace attached.
This will allow us to have a top-level handler in the server that will rewrap these into proper
BackendInternalError and thus reuse the
FrontendError framework that we implemented.