Remove relative imports.
Various changes to API for easier integration with app.