more formatting
added database support for profiles + some more formatting
now falls back to config if database connection fails