Move web console code to web api module

This will support its use in the GeoServer plugin as well.