Fix javadocs and rename some variables
Add functional tests