Can I create asset bundles dynamically in Unity 5?

I worked in a project in Unity 4.5 where I had to put assets in asset bundles and upload them to a database to be downloaded later by the game. I had a tool that did that for me automatically, I could just drag assets to an editor window and it would create/upload the bundle for me. Now with the new asset bundle system I can’t find a way to do the same. Can I create bundle dynamically through code or the editor is the only way? If that’s not possible, can I at least put assets into an asset bundle dynamically? (My idea is to have a single asset bundle and export it with different names).

If none of that works, is there an alternative doing everything by hand?

var importer = AssetImporter.GetAtPath (AssetDatabase.GetAssetPath(“…”));
importer.assetBundleName = “bundleName”;
AssetDatabase.ImportAsset (AssetDatabase.GetAssetPath(“…”));

This is what worked for me.